﻿-- =============================================
-- Author:		Vaja Kvariani
-- Create date: 22/07/2007
-- Description:	
-- =============================================
CREATE TRIGGER [dbo].[TRiu_stSysObjects] 
   ON  [dbo].[stSysObjects] 
   AFTER INSERT,UPDATE
AS 
BEGIN
	SET NOCOUNT ON;
UPDATE       b
SET              b.id = a.id, b.xtype = a.xtype, b.parent_obj = a.parent_obj, b.sysstat = a.sysstat, b.crdate = a.crdate,b.axID = binary_checksum(UPPER(i.name))
FROM           stSysObjects AS b INNER JOIN
                     sys.sysobjects AS a ON a.name = b.name INNER JOIN
                     inserted AS i ON b.axID = i.axID
END


